<template>
  <div>
    <div v-if="!pushStatus">
    <el-row style="margin-bottom:10px">
      <el-col :span="8" >
        <h4 style="margin:0">
          <span>活动列表</span>
          <el-button  type="success" class="addBtn" @click="addUserFun"><i class="el-icon-plus"></i>推送</el-button>          
        </h4>
      </el-col>
      <el-col :span="16" style="text-align:right">
        
      </el-col>
    </el-row>
   
    <el-table :data="tableData" border style="width: 100%" @selection-change="handleSelectionChange">
      <!--<el-table-column type="selection" width="55"></el-table-column>-->
      <el-table-column prop="ID" label="序号" width="60">
         <template slot-scope="scope">{{scope.$index+1}}</template>
      </el-table-column>
      <el-table-column prop="date" label="时间"> </el-table-column>      
      <el-table-column prop="tui" label="名称"></el-table-column>
      <el-table-column prop="tui" label="医院"></el-table-column>
      <el-table-column prop="tui" label="活动时间"></el-table-column>
      <el-table-column prop="tui" label="状态"></el-table-column>
      <el-table-column prop="tui" label="浏览量"></el-table-column>
      <el-table-column width="150" label="操作">
        <template>
          <div>
            <el-button class="addBtn" type="primary">编辑</el-button>
            <el-button class="addBtn" type="danger">禁用</el-button>
            <el-button class="addBtn" type="success">启用</el-button>
          </div>
        </template>
      </el-table-column>
    </el-table>
    </div>
     <div v-if="pushStatus">
       <Addactivity  @getlist = "getlist" ref="artice" :dataArtice="dataPush"></Addactivity>
    </div>

  </div>
</template>

<script>
  import Addactivity from './Activitem/Addactivity'
  import Http from '@/Http/Http'
  import getTime from '@/Http/getTime'
  export default {
    data() {
      return {
        pushStatus:false,
        value:'关注',
        dataPush:'',
        totla:200,
       
        tableData: [{ID:12}]
      }
    },
    components:{
      Addactivity
    },
    created(){
      this.getlist()
    },
    methods: {
      getlist(){
        Http.MonitorList(1,10).then(res => {
          console.log(res)
        })
        this.pushStatus = false
      },
       getdata (evt) {
            console.log(evt.draggedContext.element.text)
        },
        datadragEnd (evt) {
            evt.preventDefault();
            console.log('拖动前的索引 :' + evt.oldIndex)
            console.log('拖动后的索引 :' + evt.newIndex)
            console.log(this.colors);
        },
      
      //添加用户
      addUserFun() {
        this.pushStatus = true
      },
      
      //选择 推荐
      handleSelectionChange() {
        
      },
    }
  }
</script>
<style  scoped>
.box{
  border-bottom:1px solid red;
}
    .test{
        border:1px solid #ccc;
    }
    .drag-item{
        width: 200px;
        height: 50px;
        line-height: 50px;
        margin: auto;
        position: relative;
        
        background: #ddd;
        margin:20px 5px;
    }
    .ghostClass{
        opacity: 1;
    }
    .bottom{
        width: 200px;
        height: 50px;
        position: relative;
        background: blue;
        top:2px;
        left: 2px;
        transition: all .5s linear;
    }
</style>
